package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT\n" +
            "\tt1.role_desc \n" +
            "FROM\n" +
            "\tss_role t1,\n" +
            "\tss_role_user t2,\n" +
            "\tss_user t3 \n" +
            "WHERE\n" +
            "\tt1.role_id = t2.role_id \n" +
            "\tAND t2.user_id = t3.user_id \n" +
            "\tAND t3.user_name = #{username}")
    public List<String> selectRoles(String username);
}
